#!/bin/bash

## Desktop and icons install ##
for APP in base calc draw impress math writer; do
  echo "Adding icon $APP"
  mkdir -p $HOME/.local/share/icons/hicolor/scalable/apps/
  cp \
    /usr/share/icons/hicolor/scalable/apps/libreoffice-${APP}.svg \
    $HOME/.local/share/icons/hicolor/scalable/apps/
  echo "Adding start menu entry $APP"
  mkdir -p $HOME/.local/share/applications/
  cp \
    /usr/lib/libreoffice/share/xdg/${APP}-pa.desktop \
    $HOME/.local/share/applications/
  echo "Adding desktop shortcut $APP"
  mkdir -p $HOME/Desktop
  cp \
    /usr/lib/libreoffice/share/xdg/${APP}-pa.desktop \
    $HOME/Desktop/
  chmod +x $HOME/Desktop/${APP}-pa.desktop
done
